﻿import { Divider } from "antd";
import React from "react";
import StudentList from "@/components/StudentList";

const url ="http://127.0.0.1:8000/api/yjstudent"

const fetchStudents=async()=>{
  await new Promise((resolve,reject)=>{ 
    setTimeout(()=>{
      resolve("done");
    },2000);
  });

  const response=await fetch(url);
  if(!response.ok){
    throw new Error("something went wrong");
  }
  const data=await response.json();
  console.log(data);
  return data;
}
 async function page(){
  const students=await fetchStudents();
  return(
    // <div>Bookmarks</div>
    <div><StudentList students={students}/></div>
    // <div><StudentList/></div>
  )
}

export default page;